import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '任务ID',
    align:"center",
    dataIndex: 'wmTaskId'
   },
   {
    title: '仓库ID',
    align:"center",
    dataIndex: 'warehouseId'
   },
   {
    title: '报工入库数量',
    align:"center",
    dataIndex: 'completeQuantity'
   },
   {
    title: '剩余数量',
    align:"center",
    dataIndex: 'remainQuantity'
   },
   {
    title: '未完成部分领取物料占比',
    align:"center",
    dataIndex: 'bomRecptPercent'
   },
   {
    title: '未完成部分完成度',
    align:"center",
    dataIndex: 'notCompletePercent'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '任务ID',
    field: 'wmTaskId',
    component: 'Input',
  },
  {
    label: '仓库ID',
    field: 'warehouseId',
    component: 'Input',
  },
  {
    label: '报工入库数量',
    field: 'completeQuantity',
    component: 'InputNumber',
  },
  {
    label: '剩余数量',
    field: 'remainQuantity',
    component: 'InputNumber',
  },
  {
    label: '未完成部分领取物料占比',
    field: 'bomRecptPercent',
    component: 'Input',
  },
  {
    label: '未完成部分完成度',
    field: 'notCompletePercent',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  wmTaskId: {title: '任务ID',order: 0,view: 'text', type: 'string',},
  warehouseId: {title: '仓库ID',order: 1,view: 'text', type: 'string',},
  completeQuantity: {title: '报工入库数量',order: 2,view: 'number', type: 'number',},
  remainQuantity: {title: '剩余数量',order: 3,view: 'number', type: 'number',},
  bomRecptPercent: {title: '未完成部分领取物料占比',order: 4,view: 'text', type: 'string',},
  notCompletePercent: {title: '未完成部分完成度',order: 5,view: 'text', type: 'string',},
  remark: {title: '备注',order: 6,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}